1 /*-------------------------------------------------------------------------------------------------------*\
2 | Adium, Copyright (C) 2001-2003, Adam Iser (adamiser@mac.com | http://www.adiumx.com) |
3 \---------------------------------------------------------------------------------------------------------/
4 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU
5 | General Public License as published by the Free Software Foundation; either version 2 of the License,
6 | or (at your option) any later version.
8 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9 | the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10 | Public License for more details.
12 | You should have received a copy of the GNU General Public License along with this program; if not,
13 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14 \------------------------------------------------------------------------------------------------------ */
16 #import "AIGaimAccountViewController.h"
17 #import "CBGaimAccount.h"
19 @implementation AIGaimAccountViewController
22 - (NSString *)nibName{
23 return @"GaimOscarAIMAccountView";
26 //Configure our controls
27 - (void)configureViewAfterLoad
29 //Configure the standard controls
30 [super configureViewAfterLoad];
32 //Restrict the account name field to valid characters and length
33 //AIM: 2 to 16 characters
34 //mac.com address are an extension of AIM addresses: the username can be 2 to 16 characters
35 //so we need 24 characters (16 + @mac.com) as well as the @ symbol.
36 [textField_accountName setFormatter:
37 [AIStringFormatter stringFormatterAllowingCharacters:[NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyz0123456789@. "]
40 errorMessage:@"Your user name must be 24 characters or less, contain only letters and numbers, and start with a letter."]];
42 //Put focus on the account name
43 [[[view_accountView superview] window] setInitialFirstResponder:textField_accountName];